import { request } from '@/utils/request.js'; //导入封装好的js文件

// 微信小程序登录返回token
export const wxLoginApi = (data) => {
  return request({
    url: '/auth/wxLogin',
    method: 'post',
    data: data
  });
};

// 发送验证码
export const sendSmsCodeApi = (data) => {
  return request({
    url: '/auth/sendSmsCode',
    method: 'post',
    data: data
  });
};

// 验证码登录
export const smsLoginApi = (data) => {
  return request({
    url: '/auth/smsLogin',
    method: 'post',
    data: data
  });
};

// 父母注册
export const regUserApi = (data) => {
  return request({
    url: '/user/regUser',
    method: 'post',
    data
  });
};

// 老师注册
export const regTecherApi = (data) => {
  return request({
    url: '/user/regTecher',
    method: 'post',
    data
  });
};

// 生成芽号
export const genYCodeApi = () => {
  return request({
    url: '/user/genYCode',
    method: 'get'
  });
};

// 提交问卷
export const surveysApi = () => {
  return request({
    url: '/survey-api/surveys/S001',
    method: 'get'
  });
};

// 提交问卷
export const submissionsApi = (data) => {
  return request({
    url: '/survey-api/submissions',
    method: 'post',
    data
  });
};
